import {createRouter,createWebHistory} from "vue-router"
import Search from "../components/Search"
import HomePage from "../components/HomePage"
import User from "../components/User"
import ShopCar from '../components/ShopCar'
import Goods from '../components/options/Goods'
import Consult from '../components/options/Consult'
import Contact from '../components/options/Contact'
import News from '../components/options/News'
import Share from '../components/options/Share'
import PictrueList from '../components/options/Share/PictrueList'
import ItemList from '../components/options/Goods/ItemList'
import DetailInfo from '../components/options/Goods/DetailInfo'


const router = new createRouter({
    history:createWebHistory(),
    routes:[
        {name:"Search",component:Search,path:"/Search"},
        {name:"HomePage",component:HomePage,path:"/HomePage"},
        {component:HomePage,path:"/"},
        {name:"User",component:User,path:"/User"},
        {name:"ShopCar",component:ShopCar,path:"/ShopCar"},
        {name:"Share",component:Share,children:[
            {path:"Pictrue/:category",component:PictrueList,name:"PictrueList"},
        ],path:"/Share"},
        {name:"Goods",component:Goods,children:[
            {path:"GoodsList",component:ItemList,name:"GoodsList"},
            {path:"DetailInfo",component:DetailInfo,name:"DetailInfo",props:{title:'我过来了ow'}}
        ],path:"/Goods"},
        {name:"Consult",component:Consult,path:"/Consult"},
        {name:"Contact",component:Contact,path:"/Contact"},
        {name:"News",component:News,path:"/News"},
    ],
    // scrollBehavior(to,from,savedPosition){
    //     return {x:0,y:0}
    // }
})
export default router